package com.bing.task;

import com.bing.services.UtilService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * Created by kaibb on 16-1-15.
 */
@Component
public class JenTask {
    private static Logger LOGGER= LoggerFactory.getLogger(JenTask.class);
    @Autowired
    private UtilService utilService;

    @Scheduled(cron = "${env.backUp.cron}")
    public void backUp() {
        LOGGER.info("备份数据库任务开始!");
        utilService.backUpDB();
        LOGGER.info("备份数据库任务结束!");
    }
}
